from wcwidth import wcswidth as ww


class Student:
    """学员类"""

    def __init__(self, name, gender, tel):
        # 姓名
        self.name = name
        # 性别
        self.gender = gender
        # 手机号
        self.tel = tel

    @staticmethod
    def lpad(s, n, c=' '):
        # lpad('你好', 6) => '  \u4f60\u597d'
        return (n - ww(s)) * c + s

    @staticmethod
    def rpad(s, n, c=' '):
        # rpad('你好', 6) => '\u4f60\u597d  '
        return s + (n - ww(s)) * c

    def __str__(self):
        return f'{self.rpad(self.name, 16)}{self.rpad(self.gender, 8)}{self.tel}'
